package com.atguigu.juc.day03.collection;

import java.util.ArrayList;
import java.util.List;
import java.util.UUID;
import java.util.Vector;
import java.util.concurrent.CopyOnWriteArrayList;

public class Demo01List {

    public static void main(String[] args) {

        List<String> list =
                // new ArrayList<>();
                // new Vector<>();
                new CopyOnWriteArrayList<>();

        for (int i = 0; i < 10; i++) {
            new Thread(()->{

                for (int j = 0; j < 10; j++) {
                    String data = UUID.randomUUID().toString().replace("-", "").toUpperCase();
                    list.add(data);
                    System.out.println(list);
                }

            }, "thread-" + i).start();
        }

    }

}
